//Use Looper.getMainLooper() for avoid deprecation warning Handler(Looper.getMainLooper()).postDelayed({ // Your Code }, 3000)